package com.leapp.sk.ui.activity.leave

import android.content.Intent
import android.os.Bundle
import android.support.v4.widget.SwipeRefreshLayout
import android.view.View
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.bean.LevelEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.viewdelegate.leave.LevelDelegate

/**
 * 请假
 * @author  chaohaipeng  on 2018/8/4.
 */
class LevelActivity:BaseActivityMVP<LevelDelegate>(), SwipeRefreshLayout.OnRefreshListener{
    override fun onRefresh() {
        viewDelegate?.stopSwipRefresh()
    }

    override fun initDate() {
        val mutableListOf = mutableListOf<LevelEntity>()
        for (i in 1..1){
            mutableListOf.add(LevelEntity())
        }
        viewDelegate.initAdapter(this,mutableListOf,this)
    }

    override fun bindEvenListener() {
       viewDelegate.setOnClickListener(View.OnClickListener {
           val intent= Intent(this,LeaveEditActivity::class.java)
           startActivity(intent)
       },R.id.tv_al_leave)
    }

    override fun getDelegateClass(): Class<LevelDelegate> {
        return LevelDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }

    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_application_join_leave))
    }
}